<%-- 
    Document   : ContactAction
    Created on : Jul 2, 2014, 10:54:21 AM
    Author     : Yogesh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
       <%

                    String name=(String)request.getParameter("name");
                    String mobileNumber=(String)request.getParameter("mobile");
                    String email=(String)request.getParameter("email");
                    String pageName=(String)request.getParameter("pageName");
                    String subject=(String)request.getParameter("subject");
                    String message=(String)request.getParameter("message");


                    org.hibernate.SessionFactory sessionFactory=com.Auto.Common.ContactUs.ContactUs_HibernateUtil.getSessionFactory();
                    org.hibernate.Session Opensession=sessionFactory.openSession();
                    org.hibernate.Transaction transaction=Opensession.beginTransaction();

                    com.Auto.Common.ContactUs.Contactwithus contactwithus=new com.Auto.Common.ContactUs.Contactwithus(name, mobileNumber, email, subject, message);
                    Opensession.save(contactwithus);
                    transaction.commit();


                   

                   session.setAttribute("data","contctUs");
                   session.setAttribute("pageName",page);


                    response.sendRedirect("thankYouMessage.jsp");

        %>
    </body>
</html>
